﻿<UserControl
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	mc:Ignorable="d"
	x:Class="Tfs.OnTheRoad.Controls.HeaderControl"
	d:DesignWidth="480" d:DesignHeight="800"
    x:Name="HeaderControlPage">

    <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="0">
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"></ColumnDefinition>
                <ColumnDefinition Width="*"></ColumnDefinition>
            </Grid.ColumnDefinitions>
            <Image  Grid.Row="0" Grid.Column="0" Source="/Images/VSLogo.png" Width="32"></Image>
            <StackPanel Orientation="Vertical" Grid.Row="0" Grid.Column="1" Margin="5" VerticalAlignment="Center">
                <StackPanel Orientation="Horizontal" Margin="0">
                    <TextBlock Foreground="{StaticResource PhoneForegroundBrush}" FontWeight="Bold"  x:Name="ApplicationTitle" Text="{StaticResource ApplicationTitle}" />
                    <TextBlock Foreground="{StaticResource PhoneAccentBrush}"  VerticalAlignment="Bottom" FontSize="13" Text=" powered by TFS OData Services" />
                </StackPanel>
                <StackPanel Orientation="Horizontal" Visibility="{Binding ElementName=HeaderControlPage, Mode=TwoWay, Path=ProfileNameVisibility}">
                    <Image Source="/Images/ProfileIcon.png" Width="16"></Image>
                    <TextBlock x:Name="profileTextBox" Foreground="{StaticResource PhoneForegroundBrush}" Text="{Binding ProfileName}"></TextBlock>
                </StackPanel>
                <TextBlock Foreground="{StaticResource PhoneAccentBrush}" 
                           Visibility="{Binding ElementName=HeaderControlPage, Path=NavigationPath,Mode=TwoWay, Converter={StaticResource FieldHasValueVisibilityConverter}}"
                           FontWeight="Bold" TextWrapping="Wrap" Text="{Binding ElementName=HeaderControlPage, Mode=TwoWay, Path=NavigationPath}"
                          ></TextBlock>
            </StackPanel>
        </Grid>
        <TextBlock Visibility="{Binding ElementName=HeaderControlPage, Path=HeaderTitle,Mode=TwoWay, Converter={StaticResource FieldHasValueVisibilityConverter}}" 
                   Foreground="{StaticResource PhoneAccentBrush}" Style="{StaticResource PhoneTextTitle1Style}"  x:Name="PageTitle" 
                   Text="{Binding ElementName=HeaderControlPage,Mode=TwoWay, Path=HeaderTitle}" Margin="9,-7,0,0" />
    </StackPanel>
</UserControl>